#pragma once

#include "Containers/Containers.h"

#include "Input/MouseEventType.h"
#include "Event/MouseEvent.h"

#include <chrono>

class RMouseWidget;

class CDragDetector
{
public:
    //static CDragDetector& Get(); 

    void StartDetect(TWeakObjectPtr<RMouseWidget> InDetectingTarget,EMouseButton InButton);

    bool Detect(const  SMouseButtonEvent& InMouseEvent);

    bool IsDetecting() const ;

    TWeakObjectPtr<RMouseWidget> GetTarget() const;

    void StopDetect();
protected:
    TWeakObjectPtr<RMouseWidget>  DetectingDragging=nullptr;
    EMouseButton Button;
    //SIntPoint InitialMousePosition;
};